package com.vichat.room.service.impl;

import com.vichat.core.dao.BaseDaoI;
import com.vichat.room.entity.*;
import com.vichat.room.service.ITypedefService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

/**
 * Created by ranjx on 2017/11/20.
 */
@Service("typedefService")
public class TypedefServiceImpl implements ITypedefService{
    @Autowired
    private BaseDaoI<TypedefStyleId> styleIdDao;
    @Autowired
    private BaseDaoI<TypedefVideoId> videoIdDao;
    @Autowired
    private BaseDaoI<TypedefAudioId> audioIdDao;
    @Autowired
    private BaseDaoI<TypedefMicMode> micModeDao;
    @Autowired
    private BaseDaoI<TypedefEnterCtrl> enterCtrlDao;
    @Autowired
    private BaseDaoI<TypedefWindowId> windowIdDao;
    @Autowired
    private BaseDaoI<TypedefPttCtrl> pttCtrlDao;

    /**
     * TypedefStyleId
     * @return
     * @throws Exception
     */
    public List<TypedefStyleId> queryTypedefStyleId()throws Exception {
        String hql = "from TypedefStyleId";
        List<TypedefStyleId> styleIds = styleIdDao.find(hql);
        return styleIds;
    }
    /**
     * TypedefVideoId
     * @return
     * @throws Exception
     */
    public List<TypedefVideoId> queryTypedefVidoId()throws Exception {
        String hql = "from TypedefVideoId";
        List<TypedefVideoId> videoIds = videoIdDao.find(hql);
        return videoIds;
    }

    /**
     * TypedefAudioId
     * @return
     * @throws Exception
     */
    public List<TypedefAudioId> queryTypedefAudioId()throws Exception {
        String hql = "from TypedefAudioId";
        List<TypedefAudioId> audioIds = audioIdDao.find(hql);
        return audioIds;
    }

    /**
     * TypedefMicMode
     * @return
     * @throws Exception
     */
    public List<TypedefMicMode> queryTypedefMicMode()throws Exception {
        String hql = "from TypedefMicMode";
        List<TypedefMicMode> micModes = micModeDao.find(hql);
        return micModes;
    }

    /**
     * TypedefEnterCtrl
     * @return
     * @throws Exception
     */
    public List<TypedefEnterCtrl> queryTypedefEnterCtrl()throws Exception {
        String hql = "from TypedefEnterCtrl";
        List<TypedefEnterCtrl> enterCtrls = enterCtrlDao.find(hql);
        return enterCtrls;
    }

    /**
     * TypedefWindowId
     * @return
     * @throws Exception
     */
    public List<TypedefWindowId> queryTypedefWindowId()throws Exception {
        String hql = "from TypedefWindowId";
        List<TypedefWindowId> windowIds = windowIdDao.find(hql);
        return windowIds;
    }

    /**
     * TypedefPttCtrl
     * @return
     * @throws Exception
     */
    public List<TypedefPttCtrl> queryTypedefPttCtrl()throws Exception {
        String hql = "from TypedefPttCtrl";
        List<TypedefPttCtrl> pttCtrls = pttCtrlDao.find(hql);
        return pttCtrls;
    }

}
